<?php
class Product extends CI_Controller {
	public function index() {
		
		$this->template->write_view ( 'left', 'front_end/product/product_left', null, TRUE );
		$this->template->write_view ( 'center', 'front_end/product/index', null, TRUE );
		$this->template->write_view ( 'menu', 'front_end/layout/menu', null, TRUE );
		$this->template->write_view ( 'menu_footer', 'front_end/layout/menu_footer', null, TRUE );
		$this->template->load ();
	}
	public function allproduct($name) {
		$name = str_replace ( "-", " ", $name );
		$data ['cat'] = $this->Category_model->getCateByName ( $name );
		$this->template->write_view ( 'left', 'front_end/product/product_left', null, TRUE );
		$this->template->write_view ( 'center', 'front_end/product/nutrition', $data, TRUE );
		$this->template->write_view ( 'menu_footer', 'front_end/layout/menu_footer', null, TRUE );
		$this->template->write_view ( 'menu', 'front_end/layout/menu', null, TRUE );
		$this->template->load ();
	}
	public function product_detail($name) {
		$lang = $this->lang->lang ();
		$name = str_replace ( "-", " ", $name );
		$data ['ob'] = $this->Product_model->getProByName ( $lang, $name );
		$data ['ob_photo'] = $this->Photo_model->getImgByProId ( $name );
		if ($name == 'Seanol JIAI302' || $name =='Koso Ball' || $name == 'Duo Action' || $name == 'Zakuro Ball') {
			$this->template->write_view ( 'center', 'front_end/product/product_detail_umeken', $data, TRUE );
			$this->template->write_view ( 'left', 'front_end/product/product_left', null, TRUE );
			$this->template->write_view ( 'right', 'front_end/product/product_right_umeken', $data, TRUE );
			$this->template->write_view ( 'menu_footer', 'front_end/layout/menu_footer', null, TRUE );
			$this->template->write_view ( 'menu', 'front_end/layout/menu', null, TRUE );
			$this->template->load ();
		} else {
			
			$this->template->write_view ( 'center', 'front_end/product/product_detail', $data, TRUE );
			$this->template->write_view ( 'left', 'front_end/product/product_left', null, TRUE );
			$this->template->write_view ( 'right', 'front_end/product/product_right', $data, TRUE );
			$this->template->write_view ( 'menu_footer', 'front_end/layout/menu_footer', null, TRUE );
			$this->template->write_view ( 'menu', 'front_end/layout/menu', null, TRUE );
			$this->template->load ();
		}
	
	}


}